Set the value of objects for Enumerate Attribute

Hi at all!

I would set the values of objects of a modules that are associate at enumerate attribute values.
Specifically I must implement the follow condition on module:

If the Objects have the Object Text void, the value associate at enumerate attribute "CBI" for example must be " ", where CBI is a enumerate attribute with the follow element:

NA-->0
NC-->1
" "-->2
C -->3

I tried to associate at obj."CBI"= the value, but doesn't work.
I think the code is very simple, in the DXL manual there are example only for add or remove the enumerate value but don't if I want to set a value already configured.

I'm very grateful if someone can be help me!

thanks
Adriano
SystemAdmin - Mon Jan 21 07:48:14 EST 2013

Re: Set the value of objects for Enumerate Attribute
SystemAdmin - Tue Jan 22 02:27:18 EST 2013

obj."CBI" += " "
obj."CBI" += "NA"

and so on

Re: Set the value of objects for Enumerate Attribute
SystemAdmin - Tue Jan 22 04:49:15 EST 2013

SystemAdmin - Tue Jan 22 02:27:18 EST 2013
obj."CBI" += " "
obj."CBI" += "NA"

and so on

Ok I resolved.. Thanks a lot

Module Mod = current Module
Object Obj
for Obj in Mod do {

if(Obj."Object Heading" "" == ""){
Obj."Attribute Name 1" = " "
Obj."Attribute Name 2" = " "
}
}

Re: Set the value of objects for Enumerate Attribute
ScottKirkwood - Wed Dec 16 10:02:36 EST 2015

SystemAdmin - Tue Jan 22 04:49:15 EST 2013
Ok I resolved.. Thanks a lot

Module Mod = current Module
Object Obj
for Obj in Mod do {

if(Obj."Object Heading" "" == ""){
Obj."Attribute Name 1" = " "
Obj."Attribute Name 2" = " "
}
}

Sorry to bring this back up again, but I wanted to know how to set an object.attribute to that of another object.

For example:

module2Obj."Part Number" = module1Obj."Part Number"

does not work.  If I have one object from one module defined, as well as the object from another, I can't set one to be equal to the other.  Suggestions??

 

Thank you all for your time!

Re: Set the value of objects for Enumerate Attribute
ScottKirkwood - Wed Dec 16 10:09:10 EST 2015

ScottKirkwood - Wed Dec 16 10:02:36 EST 2015

Sorry to bring this back up again, but I wanted to know how to set an object.attribute to that of another object.

For example:

module2Obj."Part Number" = module1Obj."Part Number"

does not work.  If I have one object from one module defined, as well as the object from another, I can't set one to be equal to the other.  Suggestions??

 

Thank you all for your time!

Okay, abort...answer found.  My bad.

DOORS, for whatever reason, is different from C in that it requires some actual string after all variables and references.  Therefore, I found my own answer on a hunch that I need to place an empty string after the object reference.

This...

module2Obj."Part Number" = module1Obj."Part Number"

...needs to be written like this...

module2Obj."Part Number" = module1Obj."Part Number" ""

The error that results is VERY confusing and misleading.  It says that there is a problem with the "(=)", as if to say that I am trying to set an object.attribute equal to something of a different type.

Sorry to bug you all...but, now it's available for Google searching.

Re: Set the value of objects for Enumerate Attribute
Mike.Scharnow - Wed Dec 16 12:07:03 EST 2015

ScottKirkwood - Wed Dec 16 10:09:10 EST 2015

Okay, abort...answer found.  My bad.

DOORS, for whatever reason, is different from C in that it requires some actual string after all variables and references.  Therefore, I found my own answer on a hunch that I need to place an empty string after the object reference.

This...

module2Obj."Part Number" = module1Obj."Part Number"

...needs to be written like this...

module2Obj."Part Number" = module1Obj."Part Number" ""

The error that results is VERY confusing and misleading.  It says that there is a problem with the "(=)", as if to say that I am trying to set an object.attribute equal to something of a different type.

Sorry to bug you all...but, now it's available for Google searching.

You could also use the set function

set (module2Obj."Part Number", module1Obj."Part Number")

this looks less confusing :)